package org.me.SendSMS.utli;

import java.util.ArrayList;
import java.util.List;

import org.me.SendSMS.data.ContactDetails;
import org.me.SendSMS.data.MessageType;

import android.R.bool;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class GlobalVariable {
	
	public static int HOURS 					= 0;
	public static int MINUTE 					= 0;
	public static int HOURS_LOOP 				= 0;
	public static int MINUTE_LOOP 				= 0;
	public static int DATE 						= 0;
	public static int MONTH 					= 0;
	public static int YEAR 						= 0;
	public static boolean STARTTIME 			= false;
	public static boolean STARTTIMELOOP 		= false;
	public static boolean STARTDATE 			= false;
	public static boolean START_DATE_REPEAT 	= false;
	public static int HOURS_CURRENT;
	public static int MINUTE_CURRENT;
	public static int HOURS_CURRENT_LOOP;
	public static int MINUTE_CURRENT_LOOP;
	public static int DATE_CURRENT;
	public static int MONTH_CURRENT;
	public static int YEAR_CURRENT;
	public static boolean HIDDEN				= true;
	public static boolean CHECK_START			= true;
	public static boolean isVietNamese			= true;
	public static boolean RANDOM				= false;
	public static SharedPreferences sharePre 	= null;
	public static String numberHidden			= "";
	
	public static List<MessageType> mMessageType;
	
	
	public static String KEY_SERVICE_STATUS_ON 		= "ON";
	public static String KEY_SERVICE_STATUS_OFF		= "OFF";
	public static String SETTINGS_SERVICE_STATUS 	= "STATUS";
	public static String dateOfWeek		= "dateofweek";
	public static String time 					= "time";
	public static String timeloop 				= "timeloop";
	public static String date 					= "date";
	public static String dateRepeat 			= "dateRepeat";
	public static String number 				= "number";
	public static String message 				= "message";
	public static String numberRepeat			= "numberRepeat";
	public static String messageRepeat			= "messageRepeat";
	public static String picktime 				= "picktime";
	public static String checkeverydate 		= "checkeverydate";
	public static String random					= "random";
	public static String arrayID;
	
	public static List<String> arrID 			= new ArrayList<String>();
	public static String ARRAY_ID 				= "Mon,Tue,Wed,Thu,Fri,Sat,Sun" ;
	public static Context CONTEXT;
	
	public static boolean SEND 					= false;
	public static List<ContactDetails> listContact;
	
	public static String[] VietnameseSigns = new String[] {

		 "aAeEoOuUiIdDyY",

		 "áàạảãâấầậẩẫăắằặẳẵ",

		 "ÁÀẠẢÃÂẤẦẬẨẪĂẮẰẶẲẴ",

		 "éèẹẻẽêếềệểễ",

		 "ÉÈẸẺẼÊẾỀỆỂỄ",

		 "óòọỏõôốồộổỗơớờợởỡ",

		 "ÓÒỌỎÕÔỐỒỘỔỖƠỚỜỢỞỠ",

		 "úùụủũưứừựửữ",

		 "ÚÙỤỦŨƯỨỪỰỬỮ",

		 "íìịỉĩ",

		 "ÍÌỊỈĨ",

		 "đ",

		 "Đ",

		 "ýỳỵỷỹ",

		 "ÝỲỴỶỸ"

		 };
	
	public static void SetDefaultData(Context context, String key,String value )
	{
		sharePre = PreferenceManager.getDefaultSharedPreferences(context);
		SharedPreferences.Editor editor = sharePre.edit();
		editor.putString(key, value);
		editor.commit();
	}
		
	//Get user default data
	public static Object getDefaultData(Context context, String key)
	{
		sharePre = PreferenceManager.getDefaultSharedPreferences(context);
		return sharePre.getString(key, null);
	}
	
	//Return value string of key data
	public static String getValueKeyString(Context context, String key)
	{
		Object value = getDefaultData(context, key);
		
		if (value != null)
		{
			return value.toString();
		}
		return null;
	}

}
